package com.easy;

/**
 * Created by Lxk on 2019/3/16.
 */



public class Solution83 {
    public ListNode deleteDuplicates(ListNode head) {
        if(head == null){
            return head;
        }
        ListNode cur = head.next;
        ListNode pre = head;
        while(cur != null){
            if(((Integer)cur.val).equals(pre.val)){
                pre.next = cur.next;
                cur = pre.next;
            }else{
                pre = cur;
                cur = cur.next;
            }
        }
        return head;
    }
}
